#ifndef _SCENEMANAGERMODEL_H_
#define _SCENEMANAGERMODEL_H_

#include <QtCore/QAbstractListModel>
#include "SceneManager.h"

class SceneManagerModel : public SceneManager, public QAbstractListModel
{
public:
    enum Roles { Node = Qt::UserRole + 1, Selectable };

public:
	SceneManagerModel();
	virtual ~SceneManagerModel(void);

	// SceneManager overloads
	virtual void addObject(ObjectType type, osg::Node* pNode);
	virtual void removeObject(ObjectType type, osg::Node* pNode);

	// additional functionality
	const osg::Node* node( const QModelIndex & index ) const;
	osg::Node* node( const QModelIndex & index );
	QModelIndex index(const osg::Node* node) const;

	// Implementation of QAbstractListModel
	int rowCount( const QModelIndex & parent = QModelIndex() ) const;
	QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
	QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
	Qt::ItemFlags flags(const QModelIndex &index) const;
	bool setData(const QModelIndex &index, const QVariant &value, int role);
};

#endif // _SCENEMANAGERMODEL_H_
